//
//  GRUltimateTopBar.m
//  YC_GRice
//
//  Created by Feng Liu on 2018/9/25.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRUltimateTopBar.h"
#import "GRLocationViewController.h"
#import "GRShopSearchViewController.h"

@implementation GRUltimateTopBar

- (void)awakeFromNib {
    [super awakeFromNib];
    if (KscreenWidth == 320) {
        self.selectedCity.font              = [UIFont boldSystemFontOfSize:14];
        self.searchPlacehold.font         = [UIFont systemFontOfSize:13];
        self.glassWidthLayout.constant = 15;
    }
}

- (IBAction)changeLocationCity:(id)sender {
    GRLocationViewController *locationVc = [[GRLocationViewController alloc] init];
    [self goToNextViewController:locationVc];
}

- (IBAction)goToSearchNearbyShop:(id)sender {
    GRShopSearchViewController *searchVc = [[GRShopSearchViewController alloc] initWithCollectionViewLayout:[[UICollectionViewLeftAlignedLayout alloc] init]];
    [self goToNextViewController:searchVc];
}

- (void)goToNextViewController:(UIViewController *)viewController {
    if ([self.delegate respondsToSelector:@selector(didSelectedToNextViewController:)]) {
        [self.delegate didSelectedToNextViewController:viewController];
    }
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
